import type { AppRouteModule } from '/@/router/types';

import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';

const dashboard: AppRouteModule = {
  path: '/dashboard',
  name: 'Dashboard',
  component: LAYOUT,
  redirect: '/dashboard/workbench',
  meta: {
    title: t('首页'),// 路由title  一般必填
    affix: true,// 是否固定标签
    icon: 'ant-design:bank-filled', // 图标，也是菜单图标
    orderNo: 0, // 菜单排序，只对第一级有效
    hideChildrenInMenu: true,// 是否在子级菜单的完整path中忽略本级path
  },
  children: [
    {
      path: 'workbench',
      name: 'Workbench',
      component: () => import('/@/views/dashboard/workbench/index.vue'),
      meta: {
        title: t('首页'),
        affix: true,
        icon: 'ant-design:bank-filled',
        orderNo: 0,
        hideMenu: true,   // 当前路由不在菜单显示
        hideTab: true,    // 当前路由不在标签页显示
      },
    },
    {
      path: 'account',
      name: 'Account',
      redirect: '/dashboard/account',
      meta: {
        title: t('账户信息'),
        icon: 'ant-design:user-outlined',
        orderNo: 1,
        hideMenu: true,
      },
      children: [
        {
          path: "setting",
          name: "Setting",
          component: () => import("/@/views/dashboard/account/setting/index.vue"),
          meta: {
            title: t("账户设置"),
            icon: "ant-design:setting-filled",
            orderNo: 0,
            hideMenu: true,
            // 是否固定标签
            affix: false,
          }
        }
      ]
    },
  ],
};

export default dashboard;
